home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / sunclk.doc < prev    next >
Text File  |  1995-03-31  |  4KB  |  80 lines

  1. (Comp.sys.handhelds) 
  2. Item: 2951 by elliott at veronica.cs.wisc.edu 
  3. Author: [James Elliott] 
  4.   Subj: A Sun Clock for the HP 48sx 
  5.   Date: Sun Apr 28 1991 
  6.  
  7. I've had my HP 48sx for a month now, and it seemed like time to write 
  8. a sizable program for it, just to achieve a sense of proper ownership. 
  9. Actually, a better explanation for my motivation involves the fact 
  10. that I have a lot of icky class projects coming due and I need better 
  11. and better distractions from that ugly realization... 
  12.  
  13. One of my all-time favorite UNIX workstation programs is called 
  14. "sunclock", and it shows the regions of the Earth which are in 
  15. daylight by drawing the sunlight on a Mercator projection map of the 
  16. globe. It seemed to me that it was a moral imperative that my 
  17. calculator should be able to do this too. So, Wednesday night I set 
  18. about re-writing the program in RPL. On Thursday night I had a working 
  19. version; since then I've come up with a set of improvements to make it 
  20. need less room, update faster, and generally work well in its new HP 
  21. handheld environment. 
  22.  
  23. So here is an HP version of sunclock! I'm posting both an ASCII 
  24. version, and a uuencoded binary version. The ASCII one has been 
  25. commented, the binary is faster to download. 
  26.  
  27. SunClk is a directory which contains all the programs and variables 
  28. needed to implement the program. When you go into the directory, 
  29. you'll see a menu with "NOW", "THEN", "HELP", "ABOUT" and "TZ" as the 
  30. first five entries. The first thing you should do is set TZ to the 
  31. difference between your current time zone and UTC. For example, I am 
  32. presently in CDT, U.S. Central Daylight savings Time. That's five 
  33. hours west of Greenwich, so I store -5 in TZ. 
  34.  
  35. HELP gives you brief help about the package, ABOUT gives credits for 
  36. various aspects of its design and implementation. 
  37.  
  38. Pressing "NOW" will draw the state of the Earth as it is the moment 
  39. you press the button. This will take about a minute the first time, 
  40. since it will probably have to compute the daylight widths from 
  41. scratch. However, subsequent runs will be a lot faster, until the 
  42. sun's declination changes enough to force a recomputation. Once the 
  43. first map display is complete, it will be updated roughly once every 
  44. ten seconds (taking longer if changes need to be made). 
  45.  
  46. To end the program, hit any key other than ON/ATTN. In a few seconds 
  47. it will notice the keypress, stop whatever it is doing, and clean up 
  48. after itself before exiting (so you don't get garbage in your variable 
  49. menu). If you accidentally hit ON, you can manually purge the 
  50. variables that are before "NOW" in the menu. Or, they'll be cleaned up 
  51. on the next run. 
  52.  
  53. Pressing "THEN" will let you specify a particular date and time for 
  54. which you'd like to see the daylight pattern. It has an interface that 
  55. is very similar to the setting of an alarm; you edit the date and time 
  56. presented by entering numbers and hitting ">DATE", ">TIME" or "A/PM". 
  57. Partial dates are defaulted to the displayed day/year. Once you've 
  58. entered the time you'd like to see, press "GO", and the map will be 
  59. displayed. This is probably going to take about a minute, since the 
  60. sun will likely be in a very different place from the last computation 
  61. performed. Once the map is drawn, the program will terminate. (There 
  62. is no updating to do, since you've requested just one time to view.) 
  63.  
  64. Again, if you want to interrupt the program before it draws or 
  65. finishes the map, you can press any key other than ON/ATTN and it will 
  66. stop shortly. 
  67.  
  68. Of particular viewing interest this year are March 20 and September 23 
  69. (the first days of spring and of autumn, respectively). 
  70.  
  71. If you have the ticking clock display enabled (system flag -40, or 
  72. "CLK" on the second page of the "MODES" menu) the current date and 
  73. time will be drawn at the bottom of the map on each update. Around the 
  74. transitions between summer and winter, it will probably be difficult 
  75. to read, because the terminator boundaries will fall right in the 
  76. middle of the text. 
  77.  
  78. Anyway, I think it's a lot of fun, I hope other people enjoy it too. 
  79. Let me know if you like it! 
  80.